
SET(TARGET_LABEL "Application_")

SET(QT_MOC_SOURCES_H
  MainWindow.h
)

# Qt resource files
#set#(LIB_QT_RCS
#    images.qrc
#)

# Qt UI files
set(LIB_QT_UIS
    #    ui/sample.ui
)

IF(Qt5Widgets_FOUND)
  SET(CMAKE_AUTOMOC ON)
  #SET(CMAKE_INCLUDE_CURRENT_DIR ON)
  QT5_WRAP_UI( LIB_UI_HDRS ${LIB_QT_UIS} )
  IF(Qt5Widgets_VERSION VERSION_LESS 5.2.0)
      QT5_WRAP_CPP( LIB_UI_SRCS ${LIB_UI_HDRS} OPTIONS "-f" )
      QT5_WRAP_CPP( LIB_MOC_SRCS ${QT_MOC_SOURCES_H} OPTIONS "-f" )
  ELSE()
      QT5_WRAP_CPP( LIB_UI_SRCS ${LIB_UI_HDRS} )
      QT5_WRAP_CPP( LIB_MOC_SRCS ${QT_MOC_SOURCES_H} )
  ENDIF()
  SET(${SOURCES_CXX_MOC}
    ${LIB_UI_SRCS}
    ${LIB_MOC_SRCS}
    )
ELSE()
  QT4_WRAP_CPP( SOURCES_CXX_MOC ${QT_MOC_SOURCES_H} OPTIONS "-f" )
ENDIF()

SOURCE_GROUP(${QTMocFileGroupName} FILES ${SOURCES_CXX_MOC})

SET(TARGET_SRC
  ${QT_MOC_SOURCES_H}
  ${SOURCES_CXX_MOD}
  ${LIB_UI_HDRS}
  MainWindow.cpp
  BlueMoon.cpp
  CMakeLists.txt
  )


SET(LIB_INTERNALS
    bmCore
    bmNet
    bmQT
    bmUtil
   )

SET(LIB_DEPS
    OPENTHREADS_LIBRARY
    OSG_LIBRARY
    OSGUTIL_LIBRARY
    OSGMANIPULATOR_LIBRARY
    )

IF(QT4_FOUND)
  INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${QT_QTCORE_INCLUDE_DIR}
    ${QT_QTGUI_INCLUDE_DIR}
    ${QT_QTOPENGL_INCLUDE_DIR}
    )
  SET(LIB_DEPS
    ${LIB_DEPS}
    QT_QTCORE_LIBRARY
    QT_QTGUI_LIBRARY
    QT_QTOPENGL_LIBRARY
    )
ENDIF(QT4_FOUND)

SET(EXE_NAME BlueMoon)

BLUEMOON_ADD_EXE(${EXE_NAME} True)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

IF(Qt5Widgets_FOUND)
  qt5_use_modules(${EXE_NAME} Widgets OpenGL )
ENDIF(Qt5Widgets_FOUND)
